This page last changed on Mar 11, 2009 by aunger.

DIY REST API

The DIY supports an XML-based RESTful interface for creating, updating, retrieving and deleting the various objects which it keeps track of. This page describes the API.

Things you can manipulate

Activities

URL Summary

Result Method URL
List GET /activities.xml
Show GET /activities/:id.xml
Create POST /activities.xml
Update PUT /activities/:id.xml
Delete DELETE /activities/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<activities type="array">
  <activity>
    ...
  </activity>
  ...
</activities>
GET
<?xml version="1.0" encoding="UTF-8"?>
<activity>
  <analysis>Analysis text</analysis>
  <analysis-drawing-response type="boolean" nil="true"></analysis-drawing-response>
  <analysis-text-response type="boolean" nil="true"></analysis-text-response>
  <collectdata>Data collection text</collectdata>
  <collectdata1-calibration-active type="boolean" nil="true"></collectdata1-calibration-active>
  <collectdata1-calibration-id type="integer" nil="true"></collectdata1-calibration-id>
  <collectdata2 nil="true"></collectdata2>
  <collectdata2-calibration-active type="boolean" nil="true"></collectdata2-calibration-active>
  <collectdata2-calibration-id type="integer" nil="true"></collectdata2-calibration-id>
  <collectdata2-drawing-response type="boolean" nil="true"></collectdata2-drawing-response>
  <collectdata2-model-active type="boolean" nil="true"></collectdata2-model-active>
  <collectdata2-model-id type="integer" nil="true"></collectdata2-model-id>
  <collectdata2-probe-active type="boolean" nil="true"></collectdata2-probe-active>
  <collectdata2-probe-multi type="boolean" nil="true"></collectdata2-probe-multi>
  <collectdata2-probetype-id type="integer">1</collectdata2-probetype-id>
  <collectdata2-text-response type="boolean" nil="true"></collectdata2-text-response>
  <collectdata3 nil="true"></collectdata3>
  <collectdata3-calibration-active type="boolean" nil="true"></collectdata3-calibration-active>
  <collectdata3-calibration-id type="integer" nil="true"></collectdata3-calibration-id>
  <collectdata3-drawing-response type="boolean" nil="true"></collectdata3-drawing-response>
  <collectdata3-model-active type="boolean" nil="true"></collectdata3-model-active>
  <collectdata3-model-id type="integer" nil="true"></collectdata3-model-id>
  <collectdata3-probe-active type="boolean" nil="true"></collectdata3-probe-active>
  <collectdata3-probe-multi type="boolean" nil="true"></collectdata3-probe-multi>
  <collectdata3-probetype-id type="integer">1</collectdata3-probetype-id>
  <collectdata3-text-response type="boolean" nil="true"></collectdata3-text-response>
  <collectdata-drawing-response type="boolean" nil="true"></collectdata-drawing-response>
  <collectdata-graph-response type="boolean" nil="true"></collectdata-graph-response>
  <collectdata-model-active type="boolean" nil="true"></collectdata-model-active>
  <collectdata-probe-active type="boolean" nil="true"></collectdata-probe-active>
  <collectdata-probe-multi type="boolean" nil="true"></collectdata-probe-multi>
  <collectdata-text-response type="boolean" nil="true"></collectdata-text-response>
  <conclusion>Conclusion text</conclusion>
  <conclusion-drawing-response type="boolean" nil="true"></conclusion-drawing-response>
  <conclusion-text-response type="boolean" nil="true"></conclusion-text-response>
  <content-digest>WD2Zh8inobO2OK9lRbqUAg==</content-digest>
  <custom-otml nil="true"></custom-otml>
  <description>Description text</description>
  <draft type="boolean">true</draft>
  <further>Further investigate text</further>
  <further-drawing-response type="boolean" nil="true"></further-drawing-response>
  <further-model-active type="boolean" nil="true"></further-model-active>
  <further-model-id type="integer" nil="true"></further-model-id>
  <further-probe-active type="boolean" nil="true"></further-probe-active>
  <further-probe-multi type="boolean" nil="true"></further-probe-multi>
  <further-probetype-id type="integer">1</further-probetype-id>
  <further-text-response type="boolean" nil="true"></further-text-response>
  <furtherprobe-calibration-active type="boolean" nil="true"></furtherprobe-calibration-active>
  <furtherprobe-calibration-id type="integer" nil="true"></furtherprobe-calibration-id>
  <id type="integer">1</id>
  <introduction>Introduction text</introduction>
  <introduction-drawing-response type="boolean" nil="true"></introduction-drawing-response>
  <introduction-text-response type="boolean" nil="true"></introduction-text-response>
  <materials>Materials text</materials>
  <model-id type="integer" nil="true"></model-id>
  <name>Mixing Different Temperature Water</name>
  <nobundles type="boolean" nil="true"></nobundles>
  <parent-id type="integer" nil="true"></parent-id>
  <parent-version type="integer" nil="true"></parent-version>
  <predict>Prediction text</predict>
  <prediction-drawing-response type="boolean" nil="true"></prediction-drawing-response>
  <prediction-graph-response type="boolean" nil="true"></prediction-graph-response>
  <prediction-text-response type="boolean" nil="true"></prediction-text-response>
  <previous-user-id type="integer" nil="true"></previous-user-id>
  <probe-type-id type="integer">1</probe-type-id>
  <proced>procedure text</proced>
  <proced-drawing-response type="boolean" nil="true"></proced-drawing-response>
  <proced-text-response type="boolean" nil="true"></proced-text-response>
  <public type="boolean">true</public>
  <safety>Safety text</safety>
  <sds-offering-id type="integer">8490</sds-offering-id>
  <short-name>mixing_different_temperature_water</short-name>
  <standards>standards text (optional)</standards>
  <textile type="boolean">true</textile>
  <user-id type="integer">3</user-id>
  <uuid>1a0b7926-4dd2-11dd-8f9a-0014c2c34555</uuid>
  <version type="integer">1</version>
</activity>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • content-digest
  • custom-otml
  • draft
  • id
  • parent-id
  • parent-version
  • previous-user-id
  • sds-offering-id
  • user-id
  • uuid
  • version

Models

URL Summary

Result Method URL
List GET /models.xml
Show GET /models/:id.xml
Create POST /models.xml
Update PUT /models/:id.xml
Delete DELETE /models/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<models type="array">
  <model>
    ...
  </model>
  ...
</models>
GET
<?xml version="1.0" encoding="UTF-8"?>
<model>
  <credits nil="true"></credits>
  <description>Adapted from Step 1 of Bob Tinker's Heat Flow activity.</description>
  <height type="integer" nil="true"></height>
  <id type="integer">1</id>
  <instructions>*Start* the model, *Click* inside the model, and *Press* the arrow keys on the *keyboard*.</instructions>
  <model-type-id type="integer">1</model-type-id>
  <name>Heat Flow Step 1</name>
  <nobundles type="boolean" nil="true"></nobundles>
  <parent-id type="integer" nil="true"></parent-id>
  <parent-version type="integer" nil="true"></parent-version>
  <previous-user-id type="integer" nil="true"></previous-user-id>
  <public type="boolean">true</public>
  <sds-offering-id type="integer">8488</sds-offering-id>
  <short-name>heat_flow_step_1</short-name>
  <snapshot-active type="boolean" nil="true"></snapshot-active>
  <textile type="boolean">true</textile>
  <url>/model_files/Step1.cml</url>
  <user-id type="integer">2</user-id>
  <uuid>19ccbda8-4dd2-11dd-8f9a-0014c2c34555</uuid>
  <version type="integer">1</version>
  <width type="integer" nil="true"></width>
</model>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • id
  • parent-id
  • parent-version
  • previous-user-id
  • sds-offering-id
  • user-id
  • uuid
  • version

External OTrunk Activities

URL Summary

Result Method URL
List GET /external_otrunk_activities.xml
Show GET /external_otrunk_activities/:id.xml
Create POST /external_otrunk_activities.xml
Update PUT /external_otrunk_activities/:id.xml
Delete DELETE /external_otrunk_activities/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<external_otrunk_activities type="array">
  <external_otrunk_activity>
    ...
  </external_otrunk_activity>
  ...
</external_otrunk_activities>
GET
<?xml version="1.0" encoding="UTF-8"?>
<external-otrunk-activity>
  <custom-reporting-mode>report_mode</custom-reporting-mode>
  <description>How to interpret graphs of position and speed versus time for one-dimensional motion. </description>
  <external-otml-always-update type="boolean">true</external-otml-always-update>
  <external-otml-filename>loops-document-edit-sections-and-pages.otml</external-otml-filename>
  <external-otml-last-modified type="datetime">2008-07-16T17:14:44-04:00</external-otml-last-modified>
  <external-otml-url>http://continuum.concord.org/otrunk/examples/LOOPS/loops-document-edit-sections-and-pages.otml</external-otml-url>
  <id type="integer">1</id>
  <name>One Dimensional Motion</name>
  <nobundles type="boolean" nil="true"></nobundles>
  <otml>... otml here ...</otml>
  <parent-id type="integer" nil="true"></parent-id>
  <parent-version type="integer" nil="true"></parent-version>
  <previous-user-id type="integer" nil="true"></previous-user-id>
  <public type="boolean">true</public>
  <sds-offering-id type="integer">8493</sds-offering-id>
  <short-name>one_dimensional_motion</short-name>
  <user-id type="integer">3</user-id>
  <uuid>05df84e6-5373-11dd-b5af-0014c2c34555</uuid>
  <version type="integer">3</version>
</external-otrunk-activity>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • external-otml-filename
  • external-otml-last-modified
  • id
  • parent-id
  • parent-version
  • previous-user-id
  • sds-offering-id
  • user-id
  • uuid
  • version

If you specify 'external-otml-url', you may omit 'otml', and vice-versa.

Users

URL Summary

Result Method URL
List GET /users.xml
Show GET /users/:id.xml
Create POST /users.xml
Update PUT /users/:id.xml
Delete DELETE /users/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<users type="array">
  <user>
    ...
  </user>
  ...
</users>
GET
<?xml version="1.0" encoding="UTF-8"?>
<user>
  <created-at type="datetime">2008-07-09T12:14:25-04:00</created-at>
  <crypted-password nil="true"></crypted-password>
  <disable-javascript type="boolean" nil="true"></disable-javascript>
  <email>anonymous</email>
  <first-name>Anonymous</first-name>
  <id type="integer">1</id>
  <last-name>User</last-name>
  <login>anonymous</login>
  <password-hash>294de3557d9d00b3d2d8a1e6aab028cf</password-hash>
  <remember-token nil="true"></remember-token>
  <remember-token-expires-at type="datetime" nil="true"></remember-token-expires-at>
  <salt nil="true"></salt>
  <sds-sail-user-id type="integer">24946</sds-sail-user-id>
  <updated-at type="datetime">2008-07-09T12:14:25-04:00</updated-at>
  <uuid nil="true"></uuid>
  <vendor-interface-id type="integer">6</vendor-interface-id>
</user>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • created-at
  • crypted-password
  • id
  • password-hash
  • remember-token
  • remember-token-expires-at
  • salt
  • sds-sail-user-id
  • uuid

Reports

URL Summary

Result Method URL
List GET /reports.xml
Show GET /reports/:id.xml
Create POST /reports.xml
Update PUT /reports/:id.xml
Delete DELETE /reports/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<reports type="array">
  <report>
    ...
  </report>
  ...
</reports>
GET
<?xml version="1.0" encoding="UTF-8"?>
<report>
  <created-at type="datetime">2008-07-30T10:01:41-04:00</created-at>
  <custom-offering-id type="integer" nil="true"></custom-offering-id>
  <custom-workgroup-id type="integer" nil="true"></custom-workgroup-id>
  <description></description>
  <id type="integer">1</id>
  <name>Carolyn_OneD_group_report</name>
  <otrunk-report-template-id type="integer">2</otrunk-report-template-id>
  <previous-user-id type="integer" nil="true"></previous-user-id>
  <public type="boolean">true</public>
  <reportable-id type="integer">4</reportable-id>
  <reportable-type>ExternalOtrunkActivity</reportable-type>
  <updated-at type="datetime">2009-01-21T14:29:50-05:00</updated-at>
  <user-id type="integer">16</user-id>
  <uuid>0926ab52-5e40-11dd-af77-001ec94098a1</uuid>
</report>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • created-at
  • custom-offering-id
  • custom-workgroup-id
  • id
  • previous-user-id
  • updated-at
  • uuid

Report Types

URL Summary

Result Method URL
List GET /report_types.xml
Show GET /report_types/:id.xml
Create POST /report_types.xml
Update PUT /report_types/:id.xml
Delete DELETE /report_types/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<report-types type="array">
  <report-type>
    ...
  </report-type>
  ...
</report-types>
GET
<?xml version="1.0" encoding="UTF-8"?>
<report-type>
  <created-at type="datetime">2009-01-21T14:29:33-05:00</created-at>
  <id type="integer">1</id>
  <limit-to-one type="boolean">false</limit-to-one>
  <name>name</name>
  <updated-at type="datetime">2009-01-21T14:29:33-05:00</updated-at>
  <uri>foo:bar</uri>
  <user-id type="integer">6</user-id>
  <uuid>d4d15294-e7f1-11dd-af4e-001ec94098a1</uuid>
</report-type>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • created-at
  • id
  • updated-at
  • uuid

Report Templates

URL Summary

Result Method URL
List GET /otrunk_report_templates.xml
Show GET /otrunk_report_templates/:id.xml
Create POST /otrunk_report_templates.xml
Update PUT /otrunk_report_templates/:id.xml
Delete DELETE /otrunk_report_templates/:id.xml

XML model summary

List
<?xml version="1.0" encoding="UTF-8"?>
<otrunk-report-templates type="array">
  <otrunk-report-template>
    ...
  </otrunk-report-template>
  ...
</otrunk-report-templates>
GET
<?xml version="1.0" encoding="UTF-8"?>
<otrunk-report-template>
  <created-at type="datetime">2008-07-30T10:01:01-04:00</created-at>
  <description></description>
  <external-otml-always-update type="boolean">true</external-otml-always-update>
  <external-otml-filename>loops-one-dimension-report.otml</external-otml-filename>
  <external-otml-last-modified type="datetime">2008-07-31T17:48:52-04:00</external-otml-last-modified>
  <external-otml-url>http://continuum.concord.org/otrunk/examples/LOOPS/loops-one-dimension-report.otml</external-otml-url>
  <id type="integer">1</id>
  <name>group_report</name>
  <otml></otml>
  <parent-id type="integer" nil="true"></parent-id>
  <previous-user-id type="integer" nil="true"></previous-user-id>
  <public type="boolean">false</public>
  <sds-offering-id type="integer" nil="true"></sds-offering-id>
  <short-name>group_report</short-name>
  <updated-at type="datetime">2008-08-06T12:40:39-04:00</updated-at>
  <user-id type="integer">16</user-id>
  <uuid>f106b56c-5e3f-11dd-a54a-001ec94098a1</uuid>
  <version type="integer">24</version>
</otrunk-report-template>
POST/PUT

The XML format is the same as a GET, however you should omit the following XML elements:

  • created-at
  • external-otml-filename
  • external-otml-last-modified
  • external-otml-url (if otml is not supplied)
  • id
  • otml (if external-otml-url is not supplied)
  • parent-id
  • previous-user-id
  • sds-offering-id
  • short-name
  • updated-at
  • uuid
  • version
Document generated by Confluence on Jan 27, 2014 16:52